#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from database import db_manager

def check_characters_table():
    """检查角色表结构"""
    try:
        print("数据库连接测试...")
        info = db_manager.get_table_info('characters')
        print("\n角色表结构:")
        for row in info:
            print(f"{row['Field']}: {row['Type']}")
        
        # 检查是否有数据
        query = "SELECT COUNT(*) as count FROM characters"
        result = db_manager.execute_query(query)
        if result:
            print(f"\n角色表中共有 {result[0]['count']} 条记录")
            
    except Exception as e:
        print(f"检查失败: {e}")

if __name__ == "__main__":
    check_characters_table()